home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 54.zip / BS part 54 / FinalCopyII.adf / SampleMacros / ShadowBox < prev    next >
Encoding:
Text File  |  1992-09-02  |  2.7 KB  |  95 lines

  1. /* ---------------------------------------------------    */
  2. /* Final Copy II Arexx Macro - SHADOW BOX            */
  3. /* This macro will draw a black shadow box for the    */
  4. /* current selected object, (except lines and arrows).    */
  5. /* ---------------------------------------------------    */
  6. Options Results
  7.  
  8. /* ------------------------------------    */
  9. /* Set parameters to be in ruler units.    */
  10. /* ------------------------------------    */
  11. SetMeasure Ruler
  12.  
  13. /* -----------------------------------------    */
  14. /* These are the offsets for the shadow box    */
  15. /* in inches. (.125 = 1/8 inch).            */
  16. /* -----------------------------------------    */ 
  17. XOffset    = .125
  18. YOffset    = .125
  19.  
  20. /* ------------------------------------    */
  21. /* Get the Id of the current object.    */
  22. /* If there is no current object then    */
  23. /* exit the macro.                    */
  24. /* ------------------------------------    */
  25. CurrentObject
  26. boxid = Result
  27. IF    (boxId = 0) THEN
  28.     EXIT
  29.  
  30. /* ------------------------------------    */
  31. /* Find out the type of the object.    */
  32. /* We don't want to draw a shadow for    */
  33. /* lines or arrows.                    */
  34. /* ------------------------------------    */
  35. GetObjectType boxId
  36. type = Result
  37. IF    (type ~= 2 & type ~= 3) THEN
  38.     DO
  39.  
  40.     /* ------------------------------------    */
  41.     /* Get the coordinates and parameters    */
  42.     /* for the selected object.            */
  43.     /* ------------------------------------    */
  44.     GetObjectCoords boxid
  45.     coords = Result
  46.     GetObjectParams boxid
  47.     params = Result
  48.  
  49.     page            = Word(coords, 1)
  50.     left            = Word(coords, 2)
  51.     top            = Word(coords, 3)
  52.     width        = Word(coords, 4)
  53.     height        = Word(coords, 5)
  54.  
  55.     textflow        = Word(params, 1)
  56.     flowdist        = Word(params, 2)
  57.     link            = Word(params, 3)
  58.     transparency    = Word(params, 4)
  59.     lineweight    = Word(params, 5)
  60.     linecolor        = Word(params, 6)
  61.     fillcolor        = Word(params, 7)
  62.  
  63.     bevel = ""
  64.     IF    (type = 5) THEN
  65.         bevel = "BEVEL"
  66.  
  67.     /* -------------------------------    */
  68.     /* Draw the shadow by offsetting    */
  69.     /* the left and top values.        */
  70.     /* -------------------------------    */
  71.     left = left + XOffset
  72.     top    = top + YOffset
  73.     IF    (type = 6) THEN
  74.         DrawOval page left top width height
  75.     ELSE
  76.         DrawBox page left top width height bevel
  77.  
  78.     /* ---------------------------------------------------    */
  79.     /* Now Set the object parameters keeping the textflow    */
  80.     /* flow distance and linked the same as the original    */
  81.     /* object. Set transparency to solid, lineweight to     */
  82.     /* none and the colors to black.                    */
  83.     /* Then send the new object to the background.        */
  84.     /* ---------------------------------------------------    */
  85.     shadowId = Result
  86.     SetObjectParams shadowId textflow flowdist link 0 0 black black
  87.     ObjectToBack shadowId
  88.  
  89.     /* -------------------------------    */
  90.     /* Unselect the object and redraw.    */
  91.     /* -------------------------------    */
  92.     SelectObject 0
  93.     Redraw
  94.     END
  95.